<?php

declare(strict_types=1);
/**
 * 创建人 : Forpastime
 *
 * @link     http://hypercmf.com
 * @document https://hyperf.wiki
 * @contact  forpastime@qq.com
 * @git  https://gitee.com/hypercmf/hypercmf1.0.git
 */
namespace App\JsonRpc;

/**
 * 手动创建消费者类
 * Class CalculatorService.
 */
class CalculatorServiceConsumer extends AbstractServiceClient implements \Forpastime\Hyperf\interfaces\CalculatorServiceInterface
{
    /**
     * 定义对应服务提供者的服务名称.
     * @var string
     */
    protected $serviceName = 'CalculatorService';

    /**
     * 定义对应服务提供者的服务协议.
     * @var string
     */
    protected $protocol = 'jsonrpc-http';

    public function add(int $a, int $b): int
    {
        echo 'CalculatorService--' . $a;
        return $this->__request(__FUNCTION__, compact('a', 'b'));
    }
}
